package com.e3.basdoc.warehouse.client;

import com.e3.basdoc.warehouse.model.WarehouseModel;
import com.e3.template.tgf.TGFEditorDialog;
import com.e3.template.tgf.TGFSimpleFormPanel;
import com.e3.web.core.client.GwtAsyncCallback;

public class WarehouseEditorDialog extends TGFEditorDialog<WarehouseModel> {

	private WarehouseRPCServiceAsync service = WarehouseRPCService.Util.getInstance();
	
	@Override
	public TGFSimpleFormPanel<WarehouseModel> createFormPanel() {
		return new WarehouseFormPanel();
	}

	@Override
	public void executeNewService(WarehouseModel model, GwtAsyncCallback<WarehouseModel> callback) {
		service.newWarehouse(model, callback);
	}

	@Override
	public void executeModifyService(WarehouseModel model, GwtAsyncCallback<WarehouseModel> callback) {
		service.modifyWarehouse(model, callback);
	}

	@Override
	public String[] getNotNullFieldNames() {
		return WarehouseHelper.INSTANCE.getNotNullFieldNames();
	}

}
